
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2391. -- Cirno的忧郁 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2391: Cirno的忧郁</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>5&nbsp;&nbsp;<span class=green>Solved: </span>1<br>[<a href='submitpage.php?id=2391'>Submit</a>][<a href='problemstatus.php?id=2391'>Status</a>][<a href='bbs.php?id=2391'>Discuss</a>]</center><h2>Description</h2><div class=content><div>&nbsp;</div>
<div>Cirno闲着无事的时候喜欢冰冻青蛙。</div>
<div>Cirno每次从雾之湖中固定的n个结点中选出一些点构成一个简单多边形，Cirno运用自己的能力能将此多边形内所有青蛙冰冻。</div>
<div>雾之湖生活着m只青蛙,青蛙有大有小，所以每只青蛙的价值为一个不大于10000的正整数。</div>
<div>Cirno很想知道每次冻住的青蛙的价值总和。因为智商有限，Cirno将这个问题交给完美算术教室里的你。</div>
<div>因为爱护动物，所以每次冻结的青蛙会被放生。也就是说一只青蛙可以被多次统计。</div>
<div>&nbsp;</div></div><h2>Input</h2><div class=content><div>&nbsp;</div>
<div>第一行2个正整数 n,m。</div>
<div>以下n行，每行2个整数xi,yi,表示第i个结点的坐标。</div>
<div>再以下m行，每行3个整数xj,yj,vj，表示第j个青蛙的坐标和价值。</div>
<div>第n+m+1行一个整数q，表示有q组询问。</div>
<div>每组询问有2行，第一行一个整数s（3&lt;=s&lt;=n），表示简单多边形的结点数。第二行s个正整数，顺时针或逆时针给出多边形的结点的编号(1--n)</div>
<div>&nbsp;</div></div><h2>Output</h2><div class=content><div>&nbsp;</div>
<div>q行。</div>
<div>对于每个询问，每行输出一个整数表示冻结的青蛙的价值之和</div>
<div>&nbsp;</div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>4 3<br />
2 2<br />
3 5<br />
7 4<br />
5 1<br />
3 4 2<br />
4 3 7<br />
6 3 90<br />
2<br />
3<br />
1 2 3<br />
4<br />
1 4 3 2<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>9<br />
99<br />
【</span></div><h2>HINT</h2>
			<div class=content><p><p>数据范围】<br /><br />
对于30%的数据，n,m&lt;=100; q&lt;=100<br /><br />
对于60%的数据，n,m&lt;=100; q&lt;=10000<br /><br />
对于100%的数据，n,m&lt;=1000; q&lt;=10000<br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -10000&lt;=x,y&lt;=10000; 0&lt;v&lt;=10000<br /><br />
</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=By 杨志灿'>By 杨志灿</a></p></div><center>[<a href='submitpage.php?id=2391'>Submit</a>][<a href='problemstatus.php?id=2391'>Status</a>][<a href='bbs.php?id=2391'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
